//读取cookies 
async function getCookie(cname) {
  return new Promise((resolve) => {
    let name = cname + "=";
    let ca = document.cookie.split(';');
    for (let i = 0; i < ca.length; i++) {
      let c = ca[i].trim();
      if (c.indexOf(name) == 0) {
        resolve(c.substring(name.length, c.length));
        return;
      };
    }
    resolve("");
  });
}

export {
  getCookie
}
